
/**
 * This is a generated class and is not intended for modification.  
 */
package com.model.valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _VoScListForPOEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("self_sc", "allocated_qty", "pro_serialnumber_fk", "sc_detserialnumber");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("self_sc", "allocated_qty", "pro_serialnumber_fk", "sc_detserialnumber");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("self_sc", "allocated_qty", "pro_serialnumber_fk", "sc_detserialnumber");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("self_sc", "allocated_qty", "pro_serialnumber_fk", "sc_detserialnumber");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array("self_sc", "allocated_qty", "pro_serialnumber_fk", "sc_detserialnumber");
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "VoScListForPO";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _self_scIsValid:Boolean;
    model_internal var _self_scValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _self_scIsValidCacheInitialized:Boolean = false;
    model_internal var _self_scValidationFailureMessages:Array;
    
    model_internal var _allocated_qtyIsValid:Boolean;
    model_internal var _allocated_qtyValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _allocated_qtyIsValidCacheInitialized:Boolean = false;
    model_internal var _allocated_qtyValidationFailureMessages:Array;
    
    model_internal var _pro_serialnumber_fkIsValid:Boolean;
    model_internal var _pro_serialnumber_fkValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _pro_serialnumber_fkIsValidCacheInitialized:Boolean = false;
    model_internal var _pro_serialnumber_fkValidationFailureMessages:Array;
    
    model_internal var _sc_detserialnumberIsValid:Boolean;
    model_internal var _sc_detserialnumberValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _sc_detserialnumberIsValidCacheInitialized:Boolean = false;
    model_internal var _sc_detserialnumberValidationFailureMessages:Array;

    model_internal var _instance:_Super_VoScListForPO;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _VoScListForPOEntityMetadata(value : _Super_VoScListForPO)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["self_sc"] = new Array();
            model_internal::dependentsOnMap["allocated_qty"] = new Array();
            model_internal::dependentsOnMap["pro_serialnumber_fk"] = new Array();
            model_internal::dependentsOnMap["sc_detserialnumber"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
            model_internal::collectionBaseMap["self_sc"] = "int";
            model_internal::collectionBaseMap["allocated_qty"] = "int";
            model_internal::collectionBaseMap["pro_serialnumber_fk"] = "int";
            model_internal::collectionBaseMap["sc_detserialnumber"] = "int";
        }

        model_internal::_instance = value;
        model_internal::_self_scValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForSelf_sc);
        model_internal::_self_scValidator.required = true;
        model_internal::_self_scValidator.requiredFieldError = "self_sc is required";
        //model_internal::_self_scValidator.source = model_internal::_instance;
        //model_internal::_self_scValidator.property = "self_sc";
        model_internal::_allocated_qtyValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForAllocated_qty);
        model_internal::_allocated_qtyValidator.required = true;
        model_internal::_allocated_qtyValidator.requiredFieldError = "allocated_qty is required";
        //model_internal::_allocated_qtyValidator.source = model_internal::_instance;
        //model_internal::_allocated_qtyValidator.property = "allocated_qty";
        model_internal::_pro_serialnumber_fkValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPro_serialnumber_fk);
        model_internal::_pro_serialnumber_fkValidator.required = true;
        model_internal::_pro_serialnumber_fkValidator.requiredFieldError = "pro_serialnumber_fk is required";
        //model_internal::_pro_serialnumber_fkValidator.source = model_internal::_instance;
        //model_internal::_pro_serialnumber_fkValidator.property = "pro_serialnumber_fk";
        model_internal::_sc_detserialnumberValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForSc_detserialnumber);
        model_internal::_sc_detserialnumberValidator.required = true;
        model_internal::_sc_detserialnumberValidator.requiredFieldError = "sc_detserialnumber is required";
        //model_internal::_sc_detserialnumberValidator.source = model_internal::_instance;
        //model_internal::_sc_detserialnumberValidator.property = "sc_detserialnumber";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity VoScListForPO");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity VoScListForPO");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoScListForPO");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity VoScListForPO");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity VoScListForPO");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isSelf_scAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isAllocated_qtyAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isPro_serialnumber_fkAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSc_detserialnumberAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnSelf_sc():void
    {
        if (model_internal::_self_scIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfSelf_sc = null;
            model_internal::calculateSelf_scIsValid();
        }
    }
    public function invalidateDependentOnAllocated_qty():void
    {
        if (model_internal::_allocated_qtyIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfAllocated_qty = null;
            model_internal::calculateAllocated_qtyIsValid();
        }
    }
    public function invalidateDependentOnPro_serialnumber_fk():void
    {
        if (model_internal::_pro_serialnumber_fkIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPro_serialnumber_fk = null;
            model_internal::calculatePro_serialnumber_fkIsValid();
        }
    }
    public function invalidateDependentOnSc_detserialnumber():void
    {
        if (model_internal::_sc_detserialnumberIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfSc_detserialnumber = null;
            model_internal::calculateSc_detserialnumberIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get self_scStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get self_scValidator() : StyleValidator
    {
        return model_internal::_self_scValidator;
    }

    model_internal function set _self_scIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_self_scIsValid;         
        if (oldValue !== value)
        {
            model_internal::_self_scIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "self_scIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get self_scIsValid():Boolean
    {
        if (!model_internal::_self_scIsValidCacheInitialized)
        {
            model_internal::calculateSelf_scIsValid();
        }

        return model_internal::_self_scIsValid;
    }

    model_internal function calculateSelf_scIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_self_scValidator.validate(model_internal::_instance.self_sc)
        model_internal::_self_scIsValid_der = (valRes.results == null);
        model_internal::_self_scIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::self_scValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::self_scValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get self_scValidationFailureMessages():Array
    {
        if (model_internal::_self_scValidationFailureMessages == null)
            model_internal::calculateSelf_scIsValid();

        return _self_scValidationFailureMessages;
    }

    model_internal function set self_scValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_self_scValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_self_scValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "self_scValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get allocated_qtyStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get allocated_qtyValidator() : StyleValidator
    {
        return model_internal::_allocated_qtyValidator;
    }

    model_internal function set _allocated_qtyIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_allocated_qtyIsValid;         
        if (oldValue !== value)
        {
            model_internal::_allocated_qtyIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "allocated_qtyIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get allocated_qtyIsValid():Boolean
    {
        if (!model_internal::_allocated_qtyIsValidCacheInitialized)
        {
            model_internal::calculateAllocated_qtyIsValid();
        }

        return model_internal::_allocated_qtyIsValid;
    }

    model_internal function calculateAllocated_qtyIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_allocated_qtyValidator.validate(model_internal::_instance.allocated_qty)
        model_internal::_allocated_qtyIsValid_der = (valRes.results == null);
        model_internal::_allocated_qtyIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::allocated_qtyValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::allocated_qtyValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get allocated_qtyValidationFailureMessages():Array
    {
        if (model_internal::_allocated_qtyValidationFailureMessages == null)
            model_internal::calculateAllocated_qtyIsValid();

        return _allocated_qtyValidationFailureMessages;
    }

    model_internal function set allocated_qtyValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_allocated_qtyValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_allocated_qtyValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "allocated_qtyValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get pro_serialnumber_fkStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get pro_serialnumber_fkValidator() : StyleValidator
    {
        return model_internal::_pro_serialnumber_fkValidator;
    }

    model_internal function set _pro_serialnumber_fkIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_pro_serialnumber_fkIsValid;         
        if (oldValue !== value)
        {
            model_internal::_pro_serialnumber_fkIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fkIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fkIsValid():Boolean
    {
        if (!model_internal::_pro_serialnumber_fkIsValidCacheInitialized)
        {
            model_internal::calculatePro_serialnumber_fkIsValid();
        }

        return model_internal::_pro_serialnumber_fkIsValid;
    }

    model_internal function calculatePro_serialnumber_fkIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_pro_serialnumber_fkValidator.validate(model_internal::_instance.pro_serialnumber_fk)
        model_internal::_pro_serialnumber_fkIsValid_der = (valRes.results == null);
        model_internal::_pro_serialnumber_fkIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::pro_serialnumber_fkValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::pro_serialnumber_fkValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fkValidationFailureMessages():Array
    {
        if (model_internal::_pro_serialnumber_fkValidationFailureMessages == null)
            model_internal::calculatePro_serialnumber_fkIsValid();

        return _pro_serialnumber_fkValidationFailureMessages;
    }

    model_internal function set pro_serialnumber_fkValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_pro_serialnumber_fkValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_pro_serialnumber_fkValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fkValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get sc_detserialnumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get sc_detserialnumberValidator() : StyleValidator
    {
        return model_internal::_sc_detserialnumberValidator;
    }

    model_internal function set _sc_detserialnumberIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_sc_detserialnumberIsValid;         
        if (oldValue !== value)
        {
            model_internal::_sc_detserialnumberIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sc_detserialnumberIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get sc_detserialnumberIsValid():Boolean
    {
        if (!model_internal::_sc_detserialnumberIsValidCacheInitialized)
        {
            model_internal::calculateSc_detserialnumberIsValid();
        }

        return model_internal::_sc_detserialnumberIsValid;
    }

    model_internal function calculateSc_detserialnumberIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_sc_detserialnumberValidator.validate(model_internal::_instance.sc_detserialnumber)
        model_internal::_sc_detserialnumberIsValid_der = (valRes.results == null);
        model_internal::_sc_detserialnumberIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::sc_detserialnumberValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::sc_detserialnumberValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get sc_detserialnumberValidationFailureMessages():Array
    {
        if (model_internal::_sc_detserialnumberValidationFailureMessages == null)
            model_internal::calculateSc_detserialnumberIsValid();

        return _sc_detserialnumberValidationFailureMessages;
    }

    model_internal function set sc_detserialnumberValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_sc_detserialnumberValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_sc_detserialnumberValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sc_detserialnumberValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("self_sc"):
            {
                return self_scValidationFailureMessages;
            }
            case("allocated_qty"):
            {
                return allocated_qtyValidationFailureMessages;
            }
            case("pro_serialnumber_fk"):
            {
                return pro_serialnumber_fkValidationFailureMessages;
            }
            case("sc_detserialnumber"):
            {
                return sc_detserialnumberValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
